import {Injectable} from '@angular/core';
import {CommHttpService} from '../../../core/comm.http.service';
import {SERVERS_NAME} from '../../../config/config';
import {HttpService} from '../../../core/http.service';
import {Observable} from 'rxjs';

@Injectable()
export class DeptMngService extends CommHttpService {

  protected preUrl = `${SERVERS_NAME.SECURITY_SERVER}sys/`;

  constructor(
    protected http: HttpService
  ) {
    super(http);
  }

  /**
   * 加载学院信息
   */
  getList(data): Observable<any> {
    return this.http.get(data, `${this.preUrl}dept/list`);
  }

  /**
   * 新增
   */
  submit(data) {
    return this.http.post(data, `${this.preUrl}dept/create`);
  }

  /**
   * 更新
   */
  update(data) {
    return this.http.post(data, `${this.preUrl}dept/update`);
  }

  /**
   * 删除
   */
  delete(data) {
    return this.http.post(data, `${this.preUrl}dept/delete`);
  }

  /**
   * 获取教师
   */
  getTeachList() {
    return this.http.post({}, `${SERVERS_NAME.SECURITY_SERVER}sys/teacher/list`);
  }

}
